<?php

session_start();
echo '
    <div id="welcome"> ';
    if (isset($_SESSION['username']) && $_SESSION['username']!="")
    {
        echo 'Welcome, <a href="profile.php?uname='.$_SESSION['username'].'"> '.$_SESSION['username'].'</a>';
    }
    else echo "&nbsp";
 echo '</div>

<div id="logo">
    <h1>Stay in Belgrade</h1>
</div>

<div class="menu">
    <ul>
        <li> <a href="index.php">Home</a></li>
        <li> <a href="hostels.php">Hostels</a></li>
        <li> <a href="events.php">Events</a></li>
        <li> <a href="about.php">About</a></li>
        <li> <a href="contact.php">Contact Us</a></li>
      ';
if(isset($_SESSION['username']) && $_SESSION['username']!="")
{
      echo ("<li class='last'><a href='pages/logout.php'>Logout</a> </ul>
            </li> </ul></div> ");
}
else
      echo
          '<li class="last"><a href="">Log In</a>
          <div id="login">
          <form action="pages/add_login.php" method="post">
            <table>
                <tr>    
                    <td>Username</td>
                    <td><input type="text" name="username" /></td>
                </tr>
                <tr>
                    <td>Password</td>
                    <td><input type="password" name="password" /></td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><button type="submit" />Log In</button></td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                    or&nbsp;<a href=register.php>Sign up</a>
                    </td>
                </tr>
                </table>
                </form>
          </div>
        </li>
        </ul>
        </div>';
?>